package com.tang.framework.log.support;


import com.tang.framework.log.OperateLog;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

@Aspect
@Component
public class OperateLogAspect {


    @Resource
    private HttpServletRequest request;


    private final static String LOG_PREFIX = "======================请求日志=======================";


    @Pointcut("@annotation(com.tang.framework.log.OperateLog)")
    public void pointCut() {

    }


    @Around(value = "pointCut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
        Method method = methodSignature.getMethod();
        OperateLog operateLog = method.getAnnotation(OperateLog.class);
        return joinPoint.proceed(joinPoint.getArgs());
    }




}
